package com.bleeth.fx.meta;

/**
 * @author BleethNie
 * @version 1.0
 * @date 2022-03-12 23:08
 **/
public enum ViewTypeEnum {
    NORMAL(1, "普通"),
    MAIN(2, "主要"),
    ;

    private Integer value;

    private String name;

    ViewTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static ViewTypeEnum getMatched(Integer value) {
        ViewTypeEnum addressLevelEnum = getMatchedNull(value);
        if (addressLevelEnum != null) {
            return addressLevelEnum;
        }
        throw null;
    }

    public static ViewTypeEnum getMatchedNull(Integer value) {
        for (ViewTypeEnum item : ViewTypeEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }
}
